package StringHomeWork;

public class StringBuilderDemo {
    public static void main(String[] args) {
        String str="我要好好学习";
        StringBuilder builder =new StringBuilder(str);
        builder.append("，为了世界和平");//增
        System.out.println(builder);

        builder.replace(7,15,"是为了毁灭世界");
        System.out.println(builder);//改

        builder.insert(7,"哈哈哈啊");//插入
        System.out.println(builder);

        builder.delete(0,8);//删除
        System.out.println(builder);


}
}
